<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
 
// import Joomla view library
jimport('joomla.application.component.view');
 
/**
 * HTML View class for the Category Blog Component
 */
class ShopViewCategory extends JView
{

	// Overwriting JView display method
	function display($tpl = null) 
	{
		// Assign data to the view
		$this->state = $this->get('State');
		$this->items = $this->get('Items');
		$this->db = JFactory::getDBO();
		$this->path_img = JURI::root().'images/logo_image/';
		$this->params = &JComponentHelper::getParams( 'com_shop' );
		// Check for errors.
		if (count($errors = $this->get('Errors'))) 
		{
			JError::raiseError(500, implode('<br />', $errors));
			return false;
		}
		$id = JRequest::getVar("id");
		$db = JFactory::getDbo();
		$query = $db->getQuery(true);
		$query->select('id,title');
		$query->from('#__shop_category');
		$query->where('id = '.$id);
		$db->setQuery((string)$query);
		$this->category = $db->loadObject();
		// Display the view
		parent::display($tpl);
	}
	
	
}